/**
 * @param {number[]} nums
 * @return {number[][]}
 */

 var findSubsequences = function(nums) {
    let res =[],curr=[],len=nums.length;
    function isAdd(arr){
        for(let i=0;i<arr.length;i++){
            if(i>0&&arr[i]<arr[i-1]) return false
            
        }
        return true
    }
    function tools(stackIndex){
        if(curr.length>=2&&isAdd(curr)){
            res.push([...curr])
        }
        let set= new Set()
        for(let i=stackIndex;i<len;i++){
            if(set.has(nums[i])) continue
            curr.push(nums[i])
            set.add(nums[i])
            tools(i+1)
            curr.pop()
        }
    }
    tools(0)
    
    return res
};
console.log(findSubsequences([4,6,7,7]));